home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / DATABASE.DIR / 00114_Script_RECENT CHOICES < prev    next >
Text File  |  1996-03-28  |  1KB  |  43 lines

  1. -- ---------------------------------------------------------------
  2. -- Handler resetRecentChoices 
  3.  
  4. on resetRecentChoices
  5.   global recentChoices
  6.   
  7.   set recentChoices = []
  8. end
  9.  
  10. -- ---------------------------------------------------------------
  11. -- Handler updateRecentChoices adds the last selection to the 
  12. -- global variable last5
  13.  
  14. on updateRecentChoices 
  15.   global recentChoices, clickedTopic, numRecent
  16.   
  17.   -- this first check is because clickedtopic is void
  18.   -- before they click anything
  19.   if not(voidP(clickedTopic)) then
  20.     if count(recentChoices) = numRecent then
  21.       deleteAt(recentChoices, 1) -- delete oldest choice
  22.       append recentChoices, clickedTopic -- add most recent choice
  23.     else
  24.       append recentChoices, clickedTopic -- add most recent choice
  25.     end if
  26.   end if
  27. end
  28.  
  29. -- ---------------------------------------------------------------
  30. -- Handler goRecentChoice takes the user back to the last choice
  31.  
  32. on goRecentChoice
  33.   global recentChoices, clickedTopic, numRecent
  34.   
  35.   set numChosen = count(recentChoices)
  36.   
  37.   if (numChosen > 0) then
  38.     set clickedTopic = getAt(recentChoices,numChosen) -- get most recent
  39.     deleteAt(recentChoices, numChosen)  -- delete most recent
  40.     showTopicText -- show most recent
  41.   end if
  42. end
  43.